package com.nuanshui.heatedloan.socket.msg.handler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.nuanshui.heatedloan.socket.ProtoMsg.Msg;
import com.nuanshui.framework.springContext.SpringContextUtil;

/**
 * 
 * handler工厂
 * 
 * @author GH
 *
 */
public class HandlerFactory {

	private static final Logger logger = LoggerFactory
			.getLogger(HandlerFactory.class);

	public static IHandler getHandler(Msg m) {
		
		logger.info("获取消息处理类 【" +m.getMsgId()+"】");
		IHandler iHandler =  SpringContextUtil.getBean(m.getMsgId());
		if(iHandler == null) {//未获取到消息处理类
			logger.info("【"+m.getMsgId()+"】未获到消息处理类");
			
		}
		return iHandler;//
	}
}
